<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<link rel="stylesheet" href="__HOME__/css/style.css">
	<link rel="stylesheet" href="__HOME__/css/zhuce.css">
  <script type="text/javascript" src="__HOME__/js/jquery-1.6.2.min.js"></script>

</head>
<body>
<div class="top">
	<div id="top">
       <h1>
           <a href="index.html" class="logo">
                <img src="__HOME__/img/logo.jpg" alt="">
           </a>
           <span class="logo__txt">注册</span>
       </h1>
       <p class="logo_rt">已有账号？<a href="{:U('Login/login')}">马上登陆</a></p>
	</div>
	</div>
	<div id="main">
         <form id="j_regForm" action="" method="post">
            <div class="form__box">
                <div class="form__item">
                    <div class="form__input">
                        <input type="tel" name="phone" value="" class="j-fv-cell" placeholder="手机"  id="phone">
                    </div>    
                     <div class="form__tip j-formTip">             
                     </div>
                </div>

                <div class="form__item">
                    <div class="form__input">
                        <input maxlength="4" type="text" name="validateCode" placeholder="图形验证码" autocomplete="off">

                        <div class="form__img_code" id="j_imgCode">
                            <img src="{:U('Home/Login/verify')}" id="v">
                            <!-- <a href="javascript://">换一张</a> -->
                        </div>
                    </div>  
                </div>
                
                <div class="form__item">
                    <div class="form__input">
                        <input maxlength="6" type="tel" placeholder="短信验证码" name="phoneCode" autocomplete="off" value="">
                        <button class="form__button_msg" id="j_sendCode" type="button">获取验证短信</button>
                    </div>

                    <div class="form__tip j-formTip">               
                    </div>
                </div> 
            </div>

            <div class="form__box">
                <div class="form__item">
                    <div class="form__input">  
                        <input type="hidden" name="userName" value="dxy_qvy1e3b7">
                    </div>
                        <div class="form__tip j-formTip">            
                        </div>   
                </div>
                <div class="form__item form__item_last j-passwordWp">
                    <div class="form__input">
                        <input type="password" maxlength="16" class="j-passwordEl" name="password" placeholder="密码">
                        <a href="javascript://" class="ico__pwd j-showPassword"></a>
                </div>
                     <div class="form__tip j-formTip">            
                    </div>   
                </div>
            </div>

            <div class="form__agreement">
                <label><input type="checkbox" checked="checked" class="mobile_hide">
                我已阅读并接受</label>《<a href="http://www.dxy.cn/pages/serviceterms.html" target="_blank">瑞金特使用协议</a>》
            </div>
            <div class="form__submit">
                <button class="form__button_submit" type="submit">注册</button>
            </div>
            <div class="form__link mobile_hide">
                <a href="/accounts/reg/email?service=http://www.dxy.cn/bbs/">使用邮箱注册</a>
            </div>
            <!-- <div class="form__link pc_hide">
                <a href="/login">登录</a>
            </div> -->
            <input type="hidden" name="service" value="http://www.dxy.cn/bbs/">
        </form> 
	</div>
</body>
<script type="text/javascript">
    $('#v').click(function(){
        var src = "/Home/Login/verify/"+Math.random();
        $('#v').attr('src',src);
    })
    var InterValObj; //timer变量，控制时间
    var count = 60; //间隔函数，1秒执行
    var curCount;//当前剩余秒数
    var code = ""; //验证码
    var codeLength = 6;//验证码长度

    $('#j_sendCode').click(function(){
        curCount = count;
        $("#j_sendCode").attr("disabled", "true");
        $("#j_sendCode").text(curCount + "秒后重新获取");
        InterValObj = window.setInterval(SetRemainTime, 1000); 

        var phone = $('#phone').val();
        $.ajax({
            type: 'get',
            url: 'phone?phone='+phone,
            success:function(msg){
                if(msg == 1){
                    alert('短信验证码已发送');
                }else{
                    alert('短信发送失败');
                }
            }
        })
    })

    function SetRemainTime() {
      if (curCount == 0) {
        window.clearInterval(InterValObj);//停止计时器
        $("#j_sendCode").removeAttr("disabled");//启用按钮
        $("#j_sendCode").text("重新发送验证码");
        code = ""; //清除验证码。如果不清除，过时间后，输入收到的验证码依然有效
      }else {
        curCount--;
        $("#j_sendCode").text( curCount + "秒后重新获取");
  }
}
</script>
</html>